package com.mdata.controller;

import com.mdata.common.ResultData;
import com.mdata.model.dto.wechat.dto.UserDepartmentUpdateDTO;
import com.mdata.model.dto.wechat.result.WeChatBaseResult;
import com.mdata.service.SimpleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RequestMapping("/api/user")
@RestController
public class SimpleController {

    @Autowired
    private SimpleService simpleService;

    /**
     * 修改人员 部门
     * @param userDepartmentUpdateDTO
     * @return
     */
    @PostMapping("/updateDepartment")
    public ResultData getDepartmentTree(@RequestBody UserDepartmentUpdateDTO userDepartmentUpdateDTO) {
        WeChatBaseResult weChatBaseResult = simpleService.updateUserDepartment(userDepartmentUpdateDTO);
        return ResultData.success(weChatBaseResult);
    }
}
